{% extends "base.html" %}
{% block header %}
<link rel="stylesheet" type="text/css" href="/static/css/forms.css"/>
<script type="text/javascript" src="/static/js/jquery.treeview.js"></script>
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script type="text/javascript">
	
	$(document).ready(function(){
		$(".tabs > ul").tabs();
	    $("#browser").treeview({
            collapsed:true,
            unique: true,
            persist: "cookie",
			toggle: function() {
				console.log("%s was toggled.", $(this).find(">span").text());
			}
		});

	});
	</script>
<div class="header">
	<div class="header_left"><a href="#">LOGO</a></div>
    <div class="nav">
		<ul id="menu1">
		<li><img src="/static/img/new/nav_line.gif" width="2" height="31" border="0" /></li>
        <li><a href="/index"  onclick="nav(this)">首页</a></li>
		<li><img src="/static/img/new/nav_line.gif" width="2" height="31" border="0" /></li>
        <li><a href="/host" onclick="nav(this)">主机</a></li>
        <li><img src="/static/img/new/nav_line.gif" width="2" height="31" border="0" /></li>
        <li><a href="/monitor"   onclick="nav(this)">监控</a></li>
        <li><img src="/static/img/new/nav_line.gif" width="2" height="31" border="0" /></li>
        <li><a href="/strategy"   onclick="nav(this)">策略</a></li>
        <li><img src="/static/img/new/nav_line.gif" width="2" height="31" border="0" /></li>
        <li><a href="/group"   onclick="nav(this)">GROUP</a></li>
        <li><img src="/static/img/new/nav_line.gif" width="2" height="31" border="0" /></li>
        <li><a href="/alert"   onclick="nav(this)">报警</a></li>
        <li><img src="/static/img/new/nav_line.gif" width="2" height="31" border="0" /></li>
        <li><a href="/report"   onclick="nav(this)">报表</a></li>
        <li><img src="/static/img/new/nav_line.gif" width="2" height="31" border="0" /></li>
        <li><a href="/wiki"   onclick="nav(this)">wiki</a></li>
        <li><img src="/static/img/new/nav_line.gif" width="2" height="31" border="0" /></li>
        <li><a href="/flow"  class="nav_down"  onclick="nav(this)">流程</a></li>
        </ul>
    </div>
</div>

{% block flow_header %}

<script type="text/javascript">
$(document).ready(function(){

    $(".form-row :input").attr( {disabled:'disabled'});
    $(".form-row :input").css({"background-color": "white"});

});

</script>
{% endblock %}
{% endblock %}

{% block menu %}
    {% include "flow-menu.html" %}
{% endblock %}

{% block content %}
 <div id="mon-tit">
    <div class="left">工作流平台 >>
    {% block flow_title %}
    查看任务
    {% endblock %}
    </div>
</div>
    <div class="clr"></div>
    <hr />
    <h3 class='tit'>
    {% block task_title %}
    任务详情
    {% endblock %}
    </h3>
     {% if form.errors %}
        <p style="color: red;">
            Please correct the error{{ form.errors|pluralize }} below.
        </p>
    {% endif %}

     {% if errors %}
        <p style="color: red;">
           {{ errors }}
        </p>
    {% endif %}

     {% if message %}
        <p style="color: green;">
           {{ message }}
        </p>
    {% endif %}

    <form name="myform" action="" method="post">
        <div class="module aligned formview">
            <div  class="form-row">
                <label for="tid" >上线单ID：</label>
                <input type="text"  name="tid" maxlength="255" value={{ task.id }} /> 
            </div>

            <div  class="form-row">
                <label for="tname" >上线单名称：</label>
                <input type="text" name="tname" maxlength="255" value={{ task.tname }} /> 
            </div>

            <div  class="form-row">
                <label for="status" >上线单状态：</label>
                <input type="text" name="pid" maxlength="255" value={{ task.status}} /> 
            </div>

            <div  class="form-row">
                <label for="pid" >对应服务名称：</label>
                <input type="text" name="pid" maxlength="255" value={{ task.pid}} /> 
            </div>

            <div  class="form-row">
                <label for="auth_uid" >审核人：</label>
                <input type="text" name="auth_uid" maxlength="255" value={{ task.auth_uid}} /> 
            </div>


            <div  class="form-row">
                <label for="op_uid" >操作人员：</label>
                <input type="text" name="op_uid" maxlength="255" value={{ task.op_uid}} /> 
            </div>

            <div  class="form-row">
                <label for="hid" >对应主机名称：</label>
            	<div id="content">
					{% autoescape off %}
                    <pre>
						{{ task.hid}}
                    </pre>
					{% endautoescape %}
				</div>
            </div>

            <div class="form-row">
                <label for="detail"  >任务描述：</label>
                <div id="content">
					{% autoescape off %}
                    <pre>
						{{ task.detail}}
                    </pre>
					{% endautoescape %}
				</div>
            </div>

            <div class="form-row">
                <label for="detail"  >附件：</label>
               <!-- <input  name="attach" name="op_uid" maxlength="255" value={{ task.attach}}> -->
                <a href='/static/file/{{ task.attach }}'>查看</a>
            </div>

    <hr/>
{% if actions %}
    {% for a in actions %}
    <div style="margin:10px 0 10px 40px">
        <div style="font-weight:bold">{{a.timestamp|date:"Y-m-d H:i:s" }} </div>
        <div><strong>{{a.uid}}</strong> : {{ a.event}}</div>
        <div class='block-info'><pre>{{a.detail }}</pre></div>
    </div>
    {% endfor %}
    <hr/>
{% endif %}
    {%block task_action %}
    <div style='text-align:right'>
        <a href="/flow/" style="margin-right:40px;width:80px">返回</a>
    </div>
    {% endblock %}
</div>
</form>
{% endblock %}
